<?php
/**
 * Elgg top toolbar
 * The standard elgg top toolbar
 *
 * @package Elgg
 * @subpackage Core
 *
 */
?>

<?php
global $CONFIG;

if (isloggedin()) {
    ?>

    <div id="elgg_topbar">

        <div id="topbar_container_left">
               <a id="" href="<?php echo get_loggedin_user()->getURL(); ?>">
                    <img class="" src="<?php echo get_loggedin_user()->getIcon('topbar'); ?>" alt="User avatar" />
                    <?php echo get_loggedin_user()->username; ?>
                </a>

            <?php
            // The administration link is for admin or site admin users only
            if ($vars['user']->isAdmin()) {
                ?>

                <a href="<?php echo $vars['url']; ?>pg/admin/" class="usersettings"><?php echo elgg_echo("admin"); ?></a>

        <?php
    }
    ?>
        </div>
        
        <div id="topbar_container_center">
        <a id="" href="<?php echo $vars['config']->wwwroot; ?>"><?php echo $vars['config']->sitename; ?></a>         
        </div>
        
        <div id="topbar_container_right">	
            <?php echo elgg_view('page_elements/searchbox'); ?>
            <a href="javascript:void(0);" class="toggle_customise_edit_panel">Edit widgets</a>
    <?php echo elgg_view('output/url', array('href' => "{$vars['url']}action/logout", 'text' => elgg_echo('logout'), 'is_action' => TRUE)); ?>
        </div>        

    </div><!-- /#elgg_topbar -->

    <div class="clearfloat"></div>

    <?php
}
